package com.ziiwee.reduce.describe.creators.fields;

import org.springframework.core.ResolvableType;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Field;

/**
 * @author ziiwee
 * @data 2020/8/12
 */
public class DefaultFieldDescribeCreator extends AbstractFieldDescribeCreator {

    private final Field field;

    public DefaultFieldDescribeCreator(Field field) {
        this.field = field;
    }

    @Override
    public AnnotatedElement getElement() {
        return field;
    }

    @Override
    public ResolvableType getDefaultType() {
        return ResolvableType.forField(field);
    }

    @Override
    public String getName() {
        return field.getName();
    }
}
